<form id="loginForm" method="post" action="">
	<input id="login" name="site_username" title="логин" class="text" /> 
	<input type="password" id="pass" name="site_passwd" title="пароль" class="text" /> 
	<input title="Запомнить меня на этом компьютере" type="checkbox" id="rememberme" name="site_rememberme" value="1" style="vertical-align: middle;" />
	<input class="bt" value="ok" type="submit" /> 
	<input type="hidden" name="logme" value="1"></form>
<script type="text/javascript">
$(document).ready(
  function()
  {
	inputs = $('#loginForm .text');
	inputs.each(function () {
			obj = $(this);
			obj.val(obj.attr('title'));
	});
	inputs.focus(function() {
			obj = $(this);
			if (obj.val() == obj.attr('title')) obj.val('');
	});
	inputs.blur(function() {
			obj = $(this);
			if (obj.val() == '') obj.val(obj.attr('title'));
	});

  	$('#loginForm').submit(function () {

		if (!$('#current_username') || (this.site_username.value != $('#current_username').val())) return true;	
  	  	
		$.ajax( {url: '<?=MozgRoute::Get('http')->Create(array('module' => 'admin', 'ctrl' => 'users', 'action' => 'login_process'));?>',
				dataType: 'json',
				type: this.method,
				data: {site_username: this.site_username.value, site_passwd: this.site_passwd.value, logme: 1, site_rememberme: this.site_rememberme.checked ? 1 : 0},
				success:function (data){
							if (data.status == 2)
							{
								showMessage(data.message, true);
								return true;
							}

							$('#statusBar').html(data.data.result);

							return false;
						}
		} );

		return false;
  	});
  }
);
</script>